

function fp_showPage(page) {
  $('section[role="page"]').hide();
  $('section[page="' + page + '"]').show();
}


/**
 * Hash Parse for URL-Defined Actions. (via FIM)
 * 
 * @author Jospeph T. Parsons <josephtparsons@gmail.com>
 * @copyright Joseph T. Parsons 2012
 */
function fp_hashParse(options) {
  var urlHash = window.location.hash.substr(1),
    urlHashComponents = urlHash.split(','),
    page = '', // String
    i = 0,
    componentPieces = [],
    messageId = 0,
    roomIdLocal,
    messageId;

  for (i = 0; i < urlHashComponents.length; i += 1) {
    if (urlHashComponents[i]) {
      componentPieces = urlHashComponents[i].split('=');
      switch (componentPieces[0]) {
        case 'page': page = componentPieces[1]; break;
      }
    }
  }
  
  if (page) {
    fp_showPage(page); 
  }
}




function windowResize() {
  var ratio = parseInt($("#mini-player-helper").jPlayer('option', 'size.width')) / parseInt($("#mini-player-helper").jPlayer('option', 'size.height'));

  $("#mini-player-helper").jPlayer('option', 'size.width', $('#current-page').width());
  $("#mini-player-helper").jPlayer('option', 'size.height', $('#current-page').width() * ratio);
      
}